package org.leetcode.hard.leetcode51;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Solution2 {

    List<List<String>> res = new ArrayList<>();
    List<String> item = new ArrayList<>();

    public List<List<String>> solveNQueens(int n) {

        char[][] board = new char[n][n];

        for (char[] temp : board) {
            Arrays.fill(temp, '.');
        }

        backtracking(board,0);

        return res;
    }


    private void backtracking(char[][] board, int n1) {
        if (n1 == board.length) {
            List<String> item = arrToList(board);
            res.add(item);
            return;
        }

        for (int j = 0; j < board.length; j++) {
            if (isValid(board, n1, j)) {
                board[n1][j] = 'Q';

                backtracking(board, n1 + 1);
                board[n1][j] = '.';
            }
        }

    }

    private boolean isValid(char[][] board, int n1, int n2) {


        return true;
    }

    private List<String> arrToList(char[][] board) {
        return null;
    }
}
